package com.gexiaobao.pigeon.viewmodel

import androidx.lifecycle.MutableLiveData
import com.gexiaobao.pigeon.app.model.bean.FlyWeatherInfoResponse
import com.gexiaobao.pigeon.app.network.apiService
import com.gexiaobao.pigeon.app.util.RxToast
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel
import me.hgj.jetpackmvvm.ext.request

/**
 * @author:hxw
 * @date  :2023/1/19
 * @desc  :
 */
class MatchLineQueryViewModel : BaseViewModel() {


    var flyWeatherResult: MutableLiveData<FlyWeatherInfoResponse> = MutableLiveData()
    fun getWeatherLine(liberateLongitude: String, liberateLatitude: String, homeLongitude: String, homeLatitude: String) {
        request({ apiService.getFlyWeather(liberateLongitude, liberateLatitude, homeLongitude, homeLatitude) }, {
            flyWeatherResult.value = it
        }, {
            RxToast.showToast(it.msg)
        })
    }

}